Documentation/ Spacing
Spacing classes can be used to stitch together components. This is useful because if you build the spacing before and after a component into the component itself, it's less likely to be reusable in a different context.
All spacing classes follow a similar format: .util-[property]-[side]-[amount]
.
Class Section | Options | Description |
---|---|---|
[property]
|
margin pad |
This defines which spacing property to utilize, either |
[side]
|
all vert horiz top bottom left right |
The side options are which side of the box to place the spacing amount. For a combined |
[amount]
|
none xs sm md lg xl xxl |
The amount of spacing is a lettered value for a multiplier of the base spacer value. By default the base spacer value is |
[breakpoint]
|
@sm @md @lg @xl |
An optional section can be added to the end of the class to indicate a breakpoint value ( |
Margin
Class | Description |
---|---|
.util-margin-bottom-none
|
Removes margin from the bottom of an element. |
.util-margin-bottom-xs
|
Adds an extra small amount of margin to the bottom of an element. |
.util-margin-bottom-sm
|
Adds a small amount of margin to the bottom of an element. |
.util-margin-bottom-md
|
Adds a medium amount of margin to the bottom of an element. |
.util-margin-bottom-lg
|
Adds a large amount of margin to the bottom of an element. |
.util-margin-bottom-xl
|
Adds an extra large amount of margin to the bottom of an element. |
.util-margin-bottom-xxl
|
Adds an extra extra large amount of margin to the bottom of an element. |
.util-margin-top-none
|
Removes margin from the top of an element. |
.util-margin-top-xs
|
Adds an extra small amount of margin to the top of an element. |
.util-margin-top-sm
|
Adds a small amount of margin to the top of an element. |
.util-margin-top-md
|
Adds a medium amount of margin to the top of an element. |
.util-margin-top-lg
|
Adds a large amount of margin to the top of an element. |
.util-margin-top-xl
|
Adds an extra large amount of margin to the top of an element. |
.util-margin-top-xxl
|
Adds an extra extra large amount of margin to the top of an element. |
Padding
Class | Description |
---|---|
.util-pad-bottom-none
|
Removes padding from the bottom of an element. |
.util-pad-bottom-xs
|
Adds an extra small amount of padding to the bottom of an element. |
.util-pad-bottom-sm
|
Adds a small amount of padding to the bottom of an element. |
.util-pad-bottom-md
|
Adds a medium amount of padding to the bottom of an element. |
.util-pad-bottom-lg
|
Adds a large amount of padding to the bottom of an element. |
.util-pad-bottom-xl
|
Adds an extra large amount of padding to the bottom of an element. |
.util-pad-bottom-xxl
|
Adds an extra extra large amount of padding to the bottom of an element. |
.util-pad-top-none
|
Removes padding from the top of an element. |
.util-pad-top-xs
|
Adds an extra small amount of padding to the top of an element. |
.util-pad-top-sm
|
Adds a small amount of padding to the top of an element. |
.util-pad-top-md
|
Adds a medium amount of padding to the top of an element. |
.util-pad-top-lg
|
Adds a large amount of padding to the top of an element. |
.util-pad-top-xl
|
Adds an extra large amount of padding to the top of an element. |
.util-pad-top-xxl
|
Adds an extra extra large amount of padding to the top of an element. |
Responsive Spacing
To adjust margin and padding at different breakpoints you can add @sm
, @md
, @lg
, @xl
after any of the spacing classes:
<div class="util-margin-bottom-sm util-margin-bottom-md@md util-margin-bottom-lg@lg"></div>
<div class="util-margin-bottom-sm util-margin-bottom-md@md util-margin-bottom-lg@lg"></div>
<div class="util-margin-bottom-sm util-margin-bottom-md@md util-margin-bottom-lg@lg"></div>